import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ShopCart from '../views/ShopCart.vue'
import OrderView from "../views/OrderView.vue"
import PayOrder from "../views/PayOrder.vue"
import CateView from '../views/CateView.vue'
import MyView from '../views/MyView.vue'
import CateTwo from '../views/CateTwo.vue'
import GoodsInfo from '../views/GoodsInfo.vue'
import LoginView from '../views/LoginView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    component: HomeView
  },
  {
    path:'/cart',
    component: ShopCart
  },
  {
    path:'/order',
    component: OrderView
  },
  {
    path:'/pay',
    component: PayOrder
  },
  {
    path: '/cate',
    component: CateView,
    children : [{
      path: '/two',
      component: CateTwo
    }]
  },
  {
    path: '/my',
    component: MyView
  },
  {
    path: '/info',
    component: GoodsInfo
  },
  {
    path: '/login',
    component: LoginView
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
